set current_dest_drag to NULL when destroying, fixes bug #120007. Also
authorHans Breuer <hans@breuer.org>
Sat, 28 Feb 2004 13:21:25 +0000 (13:21 +0000)
committerHans Breuer <hans@src.gnome.org>
Sat, 28 Feb 2004 13:21:25 +0000 (13:21 +0000)
2004-02-28  Hans Breuer  <hans@breuer.org>

* gdk/win32/gdkdnd-win32.c : set current_dest_drag to NULL
when destroying, fixes bug #120007. Also removed the mirrored
ref counting for deprecated gdk_drag_context_<ref|unref>()
cause it wasn't reliable anymore anyway.

* gdk/win32/gdkdisplay-win32.c : fix typo, which should
have broken the win32 build for everyone not using msvc

* gdk/win32/gdkevents-win32.c : WM_GETMINAMXINFO ensure not to
return negative values for ptMaxTrackSize, it caused snapping
windows to their minimum size

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/win32/gdkdisplay-win32.c
gdk/win32/gdkdnd-win32.c
gdk/win32/gdkevents-win32.c

index 5f4d8d01473798491bc5a5809e919b482b9f27c3..aec037291a4e9024e9606b2939f8a4ad2a227ca8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2004-02-28  Hans Breuer  <hans@breuer.org>
+
+       * gdk/win32/gdkdnd-win32.c : set current_dest_drag to NULL
+       when destroying, fixes bug #120007. Also removed the mirrored
+       ref counting for deprecated gdk_drag_context_<ref|unref>()
+       cause it wasn't reliable anymore anyway.
+
+       * gdk/win32/gdkdisplay-win32.c : fix typo, which should
+       have broken the win32 build for everyone not using msvc
+
+       * gdk/win32/gdkevents-win32.c : WM_GETMINAMXINFO ensure not to
+       return negative values for ptMaxTrackSize, it caused snapping
+       windows to their minimum size
+
 Sat Feb 28 01:39:01 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (gtk_combo_box_set_wrap_width): Support
index 5f4d8d01473798491bc5a5809e919b482b9f27c3..aec037291a4e9024e9606b2939f8a4ad2a227ca8 100644 (file)
@@ -1,3 +1,17 @@
+2004-02-28  Hans Breuer  <hans@breuer.org>
+
+       * gdk/win32/gdkdnd-win32.c : set current_dest_drag to NULL
+       when destroying, fixes bug #120007. Also removed the mirrored
+       ref counting for deprecated gdk_drag_context_<ref|unref>()
+       cause it wasn't reliable anymore anyway.
+
+       * gdk/win32/gdkdisplay-win32.c : fix typo, which should
+       have broken the win32 build for everyone not using msvc
+
+       * gdk/win32/gdkevents-win32.c : WM_GETMINAMXINFO ensure not to
+       return negative values for ptMaxTrackSize, it caused snapping
+       windows to their minimum size
+
 Sat Feb 28 01:39:01 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (gtk_combo_box_set_wrap_width): Support
index 5f4d8d01473798491bc5a5809e919b482b9f27c3..aec037291a4e9024e9606b2939f8a4ad2a227ca8 100644 (file)
@@ -1,3 +1,17 @@
+2004-02-28  Hans Breuer  <hans@breuer.org>
+
+       * gdk/win32/gdkdnd-win32.c : set current_dest_drag to NULL
+       when destroying, fixes bug #120007. Also removed the mirrored
+       ref counting for deprecated gdk_drag_context_<ref|unref>()
+       cause it wasn't reliable anymore anyway.
+
+       * gdk/win32/gdkdisplay-win32.c : fix typo, which should
+       have broken the win32 build for everyone not using msvc
+
+       * gdk/win32/gdkevents-win32.c : WM_GETMINAMXINFO ensure not to
+       return negative values for ptMaxTrackSize, it caused snapping
+       windows to their minimum size
+
 Sat Feb 28 01:39:01 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (gtk_combo_box_set_wrap_width): Support
index 5f4d8d01473798491bc5a5809e919b482b9f27c3..aec037291a4e9024e9606b2939f8a4ad2a227ca8 100644 (file)
@@ -1,3 +1,17 @@
+2004-02-28  Hans Breuer  <hans@breuer.org>
+
+       * gdk/win32/gdkdnd-win32.c : set current_dest_drag to NULL
+       when destroying, fixes bug #120007. Also removed the mirrored
+       ref counting for deprecated gdk_drag_context_<ref|unref>()
+       cause it wasn't reliable anymore anyway.
+
+       * gdk/win32/gdkdisplay-win32.c : fix typo, which should
+       have broken the win32 build for everyone not using msvc
+
+       * gdk/win32/gdkevents-win32.c : WM_GETMINAMXINFO ensure not to
+       return negative values for ptMaxTrackSize, it caused snapping
+       windows to their minimum size
+
 Sat Feb 28 01:39:01 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (gtk_combo_box_set_wrap_width): Support
index 5f4d8d01473798491bc5a5809e919b482b9f27c3..aec037291a4e9024e9606b2939f8a4ad2a227ca8 100644 (file)
@@ -1,3 +1,17 @@
+2004-02-28  Hans Breuer  <hans@breuer.org>
+
+       * gdk/win32/gdkdnd-win32.c : set current_dest_drag to NULL
+       when destroying, fixes bug #120007. Also removed the mirrored
+       ref counting for deprecated gdk_drag_context_<ref|unref>()
+       cause it wasn't reliable anymore anyway.
+
+       * gdk/win32/gdkdisplay-win32.c : fix typo, which should
+       have broken the win32 build for everyone not using msvc
+
+       * gdk/win32/gdkevents-win32.c : WM_GETMINAMXINFO ensure not to
+       return negative values for ptMaxTrackSize, it caused snapping
+       windows to their minimum size
+
 Sat Feb 28 01:39:01 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (gtk_combo_box_set_wrap_width): Support
index 4ae4e5374e3a315369d9e277495d77ebecd1d22c..36cd1fc0c13776436e30a92277fbdeda7bac5cfd 100644 (file)
@@ -43,7 +43,7 @@ _gdk_windowing_set_default_display (GdkDisplay *display)
   g_assert (_gdk_display == display);
 }
 
-#ifdef HVAE_MONITOR_INFO
+#ifdef HAVE_MONITOR_INFO
 static BOOL CALLBACK
 count_monitor (HMONITOR hmonitor,
               HDC      hdc,
index 39be3b993b280f02df8c72037cbe11b636daa93a..2cee5ba70d3a1b4c726ee63dc1f4104badb802c0 100644 (file)
@@ -87,8 +87,6 @@ static int nformats;
  * this is used on both source and destination sides.
  */
 struct _GdkDragContextPrivateWin32 {
-  gint    ref_count;
-
   guint16 last_x;              /* Coordinates from last event */
   guint16 last_y;
   HWND    dest_xid;
@@ -140,7 +138,6 @@ gdk_drag_context_init (GdkDragContext *dragcontext)
   GdkDragContextPrivateWin32 *private = g_new0 (GdkDragContextPrivateWin32, 1);
 
   dragcontext->windowing_data = private;
-  private->ref_count = 1;
 
   contexts = g_list_prepend (contexts, dragcontext);
 }
@@ -160,7 +157,9 @@ gdk_drag_context_finalize (GObject *object)
 {
   GdkDragContext *context = GDK_DRAG_CONTEXT (object);
   GdkDragContextPrivateWin32 *private = GDK_DRAG_CONTEXT_PRIVATE_DATA (context);
-  
+  GDK_NOTE (DND, g_print ("gdk_drag_context_finalize\n"));
   g_list_free (context->targets);
 
   if (context->source_window)
@@ -173,6 +172,9 @@ gdk_drag_context_finalize (GObject *object)
   
   contexts = g_list_remove (contexts, context);
 
+  if (context == current_dest_drag)
+    current_dest_drag = NULL;
+
   g_free (private);
   
   G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -191,8 +193,6 @@ gdk_drag_context_ref (GdkDragContext *context)
 {
   g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
 
-  GDK_NOTE (DND, g_print ("gdk_drag_context_ref: %p %d\n", context, G_OBJECT(context)->ref_count));
-
   g_object_ref (context);
 }
 
@@ -201,7 +201,6 @@ gdk_drag_context_unref (GdkDragContext *context)
 {
   g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
 
-  GDK_NOTE (DND, g_print ("gdk_drag_context_unref: %p %d\n", context, G_OBJECT(context)->ref_count));
   g_object_unref (context);
 }
 
@@ -1171,6 +1170,7 @@ local_send_drop (GdkDragContext *context,
       GdkDragContextPrivateWin32 *private;
       private = GDK_DRAG_CONTEXT_PRIVATE_DATA (current_dest_drag);
 
+      /* Pass ownership of context to the event */
       tmp_event.dnd.type = GDK_DROP_START;
       tmp_event.dnd.window = current_dest_drag->dest_window;
       tmp_event.dnd.send_event = FALSE;
@@ -1180,6 +1180,8 @@ local_send_drop (GdkDragContext *context,
       tmp_event.dnd.x_root = private->last_x;
       tmp_event.dnd.y_root = private->last_y;
       
+      current_dest_drag = NULL;
+
       gdk_event_put (&tmp_event);
     }
 
@@ -1607,7 +1609,7 @@ gdk_drop_finish (GdkDragContext *context,
        
   g_return_if_fail (context != NULL);
 
-  GDK_NOTE (DND, g_print ("gdk_drop_finish\n"));
+  GDK_NOTE (DND, g_print ("gdk_drop_finish"));
 
   private = GDK_DRAG_CONTEXT_PRIVATE_DATA (context);
 
index 89e854896b1c4708ba6e161270022f9f44c37ccd..0a6827db8befa28da0a5ab6186abb22bc21cf1b0 100644 (file)
@@ -3177,14 +3177,19 @@ gdk_event_translate (GdkDisplay *display,
 
       if (impl->hint_flags & GDK_HINT_MAX_SIZE)
        {
+         int maxw, maxh;
+
          rect.left = rect.top = 0;
          rect.right = impl->hints.max_width;
          rect.bottom = impl->hints.max_height;
 
          _gdk_win32_adjust_client_rect (window, &rect);
 
-         mmi->ptMaxTrackSize.x = rect.right - rect.left;
-         mmi->ptMaxTrackSize.y = rect.bottom - rect.top;
+         /* at least on win9x we have the 16 bit trouble */
+         maxw = rect.right - rect.left;
+         maxh = rect.bottom - rect.top;
+         mmi->ptMaxTrackSize.x = maxw > 0 && maxw < G_MAXSHORT ? maxw : G_MAXSHORT;
+         mmi->ptMaxTrackSize.y = maxh > 0 && maxh < G_MAXSHORT ? maxw : G_MAXSHORT;
        }
 
       if (impl->hint_flags & (GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE))